home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form SysInfo
- Caption = "System Info"
- ClientHeight = 825
- ClientLeft = 1665
- ClientTop = 3165
- ClientWidth = 4755
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "System"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00000000&
- Height = 1230
- Icon = VBMEM.FRX:0000
- Left = 1605
- LinkMode = 1 'Source
- LinkTopic = "Form2"
- MaxButton = 0 'False
- ScaleHeight = 825
- ScaleWidth = 4755
- Top = 2820
- Width = 4875
- Begin Timer Tmr_Time
- Interval = 10025
- Left = 5370
- Top = 195
- End
- Begin Timer Tmr_Mem
- Interval = 2000
- Left = 4860
- Top = 195
- End
- Begin PictureBox Pic_Pc
- BorderStyle = 0 'None
- ForeColor = &H00000000&
- Height = 525
- Left = 240
- Picture = VBMEM.FRX:0302
- ScaleHeight = 525
- ScaleWidth = 525
- TabIndex = 2
- Top = 120
- Width = 525
- End
- Begin Label Lbl_Math
- ForeColor = &H00808000&
- Height = 255
- Left = 3135
- TabIndex = 3
- Top = 480
- Width = 1215
- End
- Begin Label Lbl_Info
- BackColor = &H00FFFFFF&
- ForeColor = &H00000000&
- Height = 405
- Left = 1110
- TabIndex = 0
- Top = 285
- Width = 1875
- End
- Begin Label Lbl_FreeMem
- ForeColor = &H00404080&
- Height = 390
- Left = 3120
- TabIndex = 1
- Top = 90
- Width = 1200
- End
- Begin Label Lbl_Mode
- ForeColor = &H00800000&
- Height = 255
- Left = 1080
- TabIndex = 4
- Top = 75
- Width = 1935
- End
- ' These are the definitions and declarations for object FORM
- DefInt A-Z
- Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags) As Long
- Declare Function GetWinFlags Lib "Kernel" () As Long
- Const WF_STANDARD = &H10
- Const WF_ENHANCED = &H20
- Const WF_80x87 = &H400
- Dim Mem As Long
- Dim Mem2 As Long
- Dim CRLF As String * 2
- Sub Form_Load ()
- Dim WinFlags As Long
- Dim Mode As String, Processor As String
- ' Center on the screen
- '
- Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
- ' Get current Windows configuration
- '
- WinFlags = GetWinFlags()
- ' CRLF variable causes a line break in a labels caption
- '
- CRLF = Chr$(13) + Chr$(10)
- ' Check Windows mode
- '
- If WinFlags And WF_ENHANCED Then
- Mode = "386 Enhanced Mode"
- Else
- Mode = "Standard Mode"
- End If
-
- ' Check for math coprocessor
- '
- If WinFlags And WF_80x87 Then
- Processor = "Present"
- Else
- Processor = "None"
- End If
- ' Put titles and values into labels
- '
- Lbl_Mode.Caption = Mode
- Lbl_Info.Caption = "Free Memory:" + CRLF + "Math Co-processor:"
- Lbl_FreeMem.Caption = CRLF + Format$(GetFreeSpace(0) \ 1024, "##,#00") + " KB"
- Lbl_Math.Caption = Processor
- End Sub
- Sub Form_Resize ()
- ' Initial check if the application is minimized.
- ' If so, display free memory in caption
- If SysInfo.WindowState = 1 Then
- SysInfo.Caption = Format$(GetFreeSpace(0) \ 1024, "##,#00") + " KB Free"
- Else
- SysInfo.Caption = "System Info"
- End If
- End Sub
- Sub Pic_Pc_Click ()
- ' Display About Box
- Msg$ = "by Charles K. Snider" + CRLF + "Compuserv 73730,1315"
- MsgBox Msg$, 64, "VBMEM v1.1"
- End Sub
- Sub Tmr_Mem_Timer ()
- On Error Resume Next
- Lbl_FreeMem.Caption = CRLF + Format$(GetFreeSpace(0) \ 1024, "##,#00") + " KB"
- ' Check if the application is minimized.
- ' If so, display free memory in caption
- ' Mem and Mem2 are compared. Mem2 is retrived by
- ' the timer every second and compared to Mem. A
- ' difference will evaluate true and only then will
- ' the caption be redisplayed. This is to avoid
- ' continuous blinking of the caption.
- Mem2 = GetFreeSpace(0)
- If SysInfo.WindowState = 1 Then
- If Mem <> Mem2 Then SysInfo.Caption = Format$(GetFreeSpace(0) \ 1024, " ##,#00") + " KB Free"
- Else
- SysInfo.Caption = "System Info"
- End If
- End Sub
- Sub Tmr_Time_Timer ()
- ' Mem is checked every 10.25 seconds
- ' (see Tmr_Mem)
- Mem = GetFreeSpace(0)
- End Sub
-